/*************************************************************************
	> File Name: Factory.cc
	> Author: Joker
	> Mail: mahongtao@foxmail.com 
	> Created Time: 2020-09-08 07:20:04
 ************************************************************************/

#include "Factory.h"
#include <iostream>

using std::cout;
using std::endl;

ConcreateProduct::ConcreateProduct(){
    cout << "construction of ConcreateProduct" << endl;
}

ConcreateProduct::~ConcreateProduct(){
    cout << "destruction of ConcreateProduct" << endl;
}

void Creator::AnOperation(){
    Product *p = FactoryMethod();
    cout << "an operation of product" << endl;
}

ConcreateCreator::ConcreateCreator(){
    cout << "construction of ConcreateCreator" << endl;
}

ConcreateCreator::~ConcreateCreator(){
    cout << "destruction of ConcreateCreator" << endl;
}

Product * ConcreateCreator::FactoryMethod(){
    return new ConcreateProduct();
}
